
#ifndef _SERIALIZER_H_
#define _SERIALIZER_H_

class CSerializer
{
	public:
		CSerializer(const char *name);

		virtual uint32 Serialize(uint8 *buffer);
		virtual uint32 DeSerialize(uint8 *buffer);

		static uint32 Wire(uint8 *buffer, uint8 data);
		static uint32 Wire(uint8 *buffer, uint16 data);
		static uint32 Wire(uint8 *buffer, uint32 data);
		static uint32 Wire(uint8 *buffer, int32 data);
		static uint32 Wire(uint8 *buffer, const char *data);
		static uint32 Wire(uint8 *buffer, uint8 *data, uint32 size);

		static uint32 UnWire(uint8 *buffer, uint8 *data);
		static uint32 UnWire(uint8 *buffer, uint16 *data);
		static uint32 UnWire(uint8 *buffer, uint32 *data);
		static uint32 UnWire(uint8 *buffer, int32 *data);
		static uint32 UnWire(uint8 *buffer, char *data);
		uint32 UnWire(uint8 *buffer, uint8 *data, uint32 size);

	protected:
		uint32	m_serialize_fingerprint;

	protected:
		void FindFingerprint(const char *name);
};

#endif
